<?php

class Ext_Buddy_Check
{
    protected $_buddyUserId;
    
    public function __construct($buddyUserId)
    {
        $this->_buddyUserId = $buddyUserId;
    }
    
    public function isMyBuddy()
    {
        $userId = Ext_Auth_Front::getInstance()->getIdentity();
        
        return $this->isBuddy($userId);
    }
    
    public function isBuddy($userId)
    {
        $_appModelDbTableBuddy = new App_Model_DbTable_Buddy();
        
        $buddyRow = App_Model_DbTable_Buddy::getInstance()->getRowByUserIdBuddyUserId($userId, $this->_buddyUserId);
        if($buddyRow)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
}